﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Areas/CustomerAdmin/Customer.Master" CodeBehind="AccountList.aspx.cs" Inherits="OnlineBusinesses.Areas.CustomerAdmin.AccountList" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="ContentCustomerAdmin">
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 10px;">
        <h4 class="text-success">
            <asp:Label ID="lbNotice" runat="server"></asp:Label>
        </h4>
        <h3 style="font-weight: bold;">Quản lý người dùng </h3>
        <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 5px;">
            <a href="Account.aspx" style="color: #fff; text-decoration: none;">
                <span class="pull-right btn btn-default" onclick="ShowProgress();" style="border-radius: 0px; background: #FFAA00; color: #fff;">Tạo người dùng
                </span>
            </a>
        </div>
    </div>
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 0px; margin: 10px 0px; height: 1px; background: #ddd;"></div>
    <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="padding: 10px 0px;">
        <div class="col-md-12 col-lg-12 col-xs-12 col-sm-12" style="border: 0px; padding: 0px;">
            <div class="table-responsive">
                <asp:ListView
                    ID="lvAccount"
                    runat="server">
                    <LayoutTemplate>
                        <table class="table table-bordered table-striped" id="dataTables-example">
                            <thead>
                                <tr>
                                    <th style="width: 50px; text-align: center;">STT</th>
                                    <th>Tên tài khoản</th>
                                    <th>Email</th>
                                    <th>Số điện thoại</th>
                                    <th style="width: 280px; padding-left: 10px;">Tùy chỉnh</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr id="ItemPlaceholder" runat="server">
                                </tr>
                            </tbody>
                        </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <tr>
                            <td style="vertical-align: middle; text-align: center;"><%# Container.DisplayIndex + 1  %></td>
                            <td style="vertical-align: middle;"><%# Eval("AccountName") %></td>
                            <td style="vertical-align: middle;"><%# Eval("Email") %></td>
                            <td style="vertical-align: middle;"><%# Eval("Phone") %></td>
                            <td style="vertical-align: middle; text-align: right;">
                                <a href="Account.aspx?id=<%# Eval("AccountID") %>" onclick="ShowProgress();" style="color: #fff; text-decoration: none;">
                                    <span class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Chỉnh sửa" style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-wrench"></span></span>
                                </a>
                                <asp:LinkButton runat="server" ID="btnResetPassword"
                                    OnCommand="btnResetPassword_Click" OnClientClick="ShowProgress();" CommandArgument='<%#Eval("AccountID") %>'
                                    class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Làm mới mật khẩu"
                                    Style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-repeat"></span></asp:LinkButton>
                                <asp:LinkButton OnClientClick="ShowProgress();" runat="server" ID="btnBlock"
                                    OnCommand="btnBlock_Click" CommandArgument='<%#Eval("AccountID") %>'
                                    class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Khóa"
                                    Style="border-radius: 0px; margin-right: 10px;"><span class="fa <%# bool.Parse(Eval("IsBlock").ToString()) == true ? "fa-lock text-danger" : "fa-unlock"  %>"></span></asp:LinkButton>
                                <asp:LinkButton runat="server" ID="btnDel"
                                    OnCommand="btnDel_Click" CommandArgument='<%#Eval("AccountID") %>'
                                    OnClientClick="return confirm('Bạn có chắc là muốn xoá tài khoản này không?');"
                                    class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Xóa"
                                    Style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-times"></span></asp:LinkButton>
                                <a href="Rules.aspx?aid=<%#Eval("accountid") %>" onclick="ShowProgress();" style="color: #fff; text-decoration: none;">
                                    <span class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Phân quyền" style="border-radius: 0px; margin-right: 10px;"><span class="fa fa-check-square-o"></span></span>
                                </a>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>
            </div>
        </div>
    </div>
</asp:Content>
